//
//  StrategySecondInlandTableViewCell.m
//  ITrip
//
//  Created by dllo on 15/5/27.
//  Copyright (c) 2015年 lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "StrategySecondInlandTableViewCell.h"

@implementation StrategySecondInlandTableViewCell

- (void)dealloc
{
    [self.second_Inland_name_zh_cn_Label release];
    [self.second_Inland_name_en_Label release];
    [self.secondInlandImageview release];
    [self.InlandAddressButton release];
    [self.InlandJourneyButton release];
    [self.InlandStrategyButton release];
    [self.InlandTopicButton release];
    [super dealloc];
}

- (void)setStrategySecondInlandModel:(StrategySecondInlandModel *)strategySecondInlandModel
{
    self.second_Inland_name_zh_cn_Label.text = strategySecondInlandModel.second_inland_name_zh_cn;
    self.second_Inland_name_en_Label.text = strategySecondInlandModel.second_inland_name_en;
    [self.secondInlandImageview setImageWithURL:[NSURL URLWithString:strategySecondInlandModel.second_inland_image_url] placeholderImage:[UIImage imageNamed:@"defaultPic_Down"]];
//    if (strategySecondInlandModel.wiki_app_publish) {
//        [self.InlandStrategyButton setTitle:@"攻略" forState:UIControlStateNormal];
//        self.strategyButtonTag = 1;
//    } else {
        [self.InlandStrategyButton setTitle:@"游  记" forState:UIControlStateNormal];
//        self.strategyButtonTag = 2;
//    }
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createMyView];
    }
    return self;
}

- (void)createMyView
{
    self.secondInlandImageview = [[UIImageView alloc]init];
    [self.contentView addSubview:self.secondInlandImageview];
    
    self.second_Inland_name_zh_cn_Label = [[UILabel alloc]init];
    [self.secondInlandImageview addSubview:self.second_Inland_name_zh_cn_Label];
    
    self.second_Inland_name_en_Label = [[UILabel alloc]init];
    [self.secondInlandImageview addSubview:self.second_Inland_name_en_Label];
    
    self.InlandAddressButton = [UIButton buttonWithType:UIButtonTypeCustom];
    [self.contentView addSubview:self.InlandAddressButton];
    
    self.InlandJourneyButton = [UIButton buttonWithType:UIButtonTypeCustom];
    [self.contentView addSubview:self.InlandJourneyButton];
    
    self.InlandStrategyButton = [UIButton buttonWithType:UIButtonTypeCustom];
    [self.contentView addSubview:self.InlandStrategyButton];
    
    self.InlandTopicButton = [UIButton buttonWithType:UIButtonTypeCustom];
    [self.contentView addSubview:self.InlandTopicButton];
    
    
 
    
    [self.second_Inland_name_en_Label release];
    [self.second_Inland_name_zh_cn_Label release];
    [self.secondInlandImageview release];
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    
    self.secondInlandImageview.frame = CGRectMake(0, 0, self.frame.size.width, 210);
    self.secondInlandImageview.backgroundColor = [UIColor whiteColor];
    
    self.second_Inland_name_zh_cn_Label.frame = CGRectMake(10, 10, 200, 30);
    self.second_Inland_name_zh_cn_Label.backgroundColor = [UIColor clearColor];
    self.second_Inland_name_zh_cn_Label.textColor = [UIColor whiteColor];
    self.second_Inland_name_zh_cn_Label.font = [UIFont boldSystemFontOfSize:20];
    
    self.second_Inland_name_en_Label.frame = CGRectMake(10, 35, 120, 30);
    self.second_Inland_name_en_Label.backgroundColor = [UIColor clearColor];
    self.second_Inland_name_en_Label.textColor = [UIColor whiteColor];
    self.second_Inland_name_en_Label.font = [UIFont systemFontOfSize:15];
    
    self.InlandStrategyButton.frame = CGRectMake(0, 210, self.frame.size.width / 4, 70);
    self.InlandStrategyButton.backgroundColor = [UIColor whiteColor];
//    [self.InlandStrategyButton setTitle:@"攻 略" forState:UIControlStateNormal];
    [self.InlandStrategyButton setImage:[UIImage imageNamed:@"iconfont-dengpao"] forState:UIControlStateNormal];
    [self.InlandStrategyButton setTitleEdgeInsets:UIEdgeInsetsMake(40, -25, 0, 0)];
    [self.InlandStrategyButton setImageEdgeInsets:UIEdgeInsetsMake(0, 25, 25, 20)];
    [self.InlandStrategyButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    
    self.InlandJourneyButton.frame = CGRectMake(self.frame.size.width / 4, 210, self.frame.size.width / 4, 70);
    self.InlandJourneyButton.backgroundColor = [UIColor whiteColor];
    [self.InlandJourneyButton setTitle:@"行 程" forState:UIControlStateNormal];
    [self.InlandJourneyButton setImage:[UIImage imageNamed:@"iconfont-xianlu"] forState:UIControlStateNormal];
    [self.InlandJourneyButton setTitleEdgeInsets:UIEdgeInsetsMake(40, -30, 0, 0)];
    [self.InlandJourneyButton setImageEdgeInsets:UIEdgeInsetsMake(0, 20, 25, 20)];
    [self.InlandJourneyButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    
    self.InlandAddressButton.frame = CGRectMake(self.frame.size.width / 2, 210, self.frame.size.width / 4, 70);
    self.InlandAddressButton.backgroundColor = [UIColor whiteColor];
    [self.InlandAddressButton setTitle:@"旅行地" forState:UIControlStateNormal];
    [self.InlandAddressButton setImage:[UIImage imageNamed:@"iconfont-huilvxing"] forState:UIControlStateNormal];
    [self.InlandAddressButton setTitleEdgeInsets:UIEdgeInsetsMake(40, -30, 0, 0)];
    [self.InlandAddressButton setImageEdgeInsets:UIEdgeInsetsMake(0, 25, 25, 20)];
    [self.InlandAddressButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    
    self.InlandTopicButton.frame = CGRectMake(self.frame.size.width / 4 * 3, 210, self.frame.size.width / 4, 70);
    self.InlandTopicButton.backgroundColor = [UIColor whiteColor];
    [self.InlandTopicButton setTitle:@"专 题" forState:UIControlStateNormal];
    [self.InlandTopicButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    [self.InlandTopicButton setImage:[UIImage imageNamed:@"iconfont-remenzhuanti"] forState:UIControlStateNormal];
    [self.InlandTopicButton setTitleEdgeInsets:UIEdgeInsetsMake(40, -30, 0, 0)];
    [self.InlandTopicButton setImageEdgeInsets:UIEdgeInsetsMake(0, 25, 25, 20)];

    
}




- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
